Write the linear function k